﻿using Basic.FlowGatewayModule.Interface;
using Basic.FlowRemoteModel.NodeRoute.Model;
using WeDonekRpc.ApiGateway.Attr;
using WeDonekRpc.Helper.Validate;
using WeDonekRpc.HttpApiGateway;

namespace Basic.FlowGatewayModule.Api
{
    [ApiRouteName("/flow/node/route/{name}")]
    internal class FlowNodeRouteApi : ApiController
    {
        private readonly IFlowNodeRouteService _Service;

        public FlowNodeRouteApi ( IFlowNodeRouteService service )
        {
            this._Service = service;
        }

        public long Add ( RouteAdd data )
        {
            return this._Service.Add(data);
        }

        public void Delete ( [NumValidate("flow.node.route.id.error", 1)] long id )
        {
            this._Service.Delete(id);
        }
    }
}
